package com.cbb.lease.controller;

import com.cbb.lease.pojo.entity.Comment;
import com.cbb.lease.pojo.entity.Shop;
import com.cbb.lease.pojo.vo.CommentVo;
import com.cbb.lease.service.CommentService;
import com.gsj.common.pojo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-eighth01
 * @description: 这是 一个Comment的Controller
 * @author: 陈斌斌
 * @create: 2021-07-25 14:55
 **/
@RestController
@RequestMapping("lease/comment")
@Api(value = "lease/comment")
public class CommentController {
    @Resource
    private CommentService commentService;

    @ApiOperation(value = "getComment",httpMethod = "get")
    @PostMapping("getComment/{currentPage}/{pageSize}")
    public R getComment(@PathVariable("currentPage")Integer currentPage,
                        @PathVariable("pageSize")Integer pageSize,
                        @RequestBody CommentVo comment){
        return commentService.getComment(currentPage,pageSize,comment);
    }

    @ApiOperation(value = "delById",httpMethod = "delete")
    @DeleteMapping("delById")
    public R delById(@ApiParam(value = "类型主键ID")
                             Integer id){
        return commentService.delById(id);
    }


}
